package com.hspedu.writer;

import org.junit.jupiter.api.Test;

import java.io.FileWriter;
import java.io.IOException;

/**
 * @author 谷其昊
 * @version 1.0
 * @date 2022/2/23
 * @time 22:46
 */
public class FileWriter_ {
    public static void main(String[] args) {

    }


    @Test
    public void write01() {
        String fileName = "D:\\BaiduNetdiskDownload\\韩顺平2021基础学Java\\temp\\note.txt";
        FileWriter fileWriter = null;
        try {
            fileWriter = new FileWriter(fileName);
            fileWriter.write("风雨之后，定见彩虹");
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                fileWriter.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
